package router

import (
	"batbat-backend/app/api"
	"batbat-backend/app/service"
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/net/ghttp"
)

// 游戏评论接口路由
func init() {
	g.Server().Group("/game/:id/review", func(group *ghttp.RouterGroup) {
		group.Middleware(service.Middleware.Login)

		group.GET("/", api.GameReview.GetGameReviews)
		group.POST("/", api.GameReview.NewGameReview).Middleware(service.Middleware.NeedLogin)
		group.DELETE("/", api.GameReview.DeleteGameReview).Middleware(service.Middleware.NeedLogin)
		group.POST("/:rid/up", api.GameReview.Up).Middleware(service.Middleware.NeedLogin)
		group.DELETE("/:rid/up", api.GameReview.UnUp).Middleware(service.Middleware.NeedLogin)
	})
}
